<template>
  <div class="goods" @click="goodsDetail" :style="styleData" :data-id="item.id">
    <div class="picture"><img v-lazy="{src:item.img640,loading:lazyPic}" alt=""></div>
    <div class="title">{{item.name}}</div>
    <div class="price">
      <span class="curr"><i>￥</i><em>{{item.price}}</em></span>
    </div>
    <div class="btn">立即抢</div>
  </div>
  <!-- <div class="goods" @click="goodsDetail" :style="styleData" :data-id="item.goods_id">
    <div class="picture"><img v-lazy="{src:'//img30.360buyimg.com/babel/s170x180_jfs/t28648/179/63691475/75477/f38cc744/5be6a4f7N6a040b4e.jpg!q90!cc_170x180',loading:lazyPic}" alt=""></div>
    <div class="title">耐克官网男鞋x sacai联名走秀款解构红蓝黄绿跑步女鞋AA3833-002</div>
    <div class="price">
      <span class="curr"><i>￥</i><em>2129.00</em></span>
    </div>
    <div class="btn">立即抢</div>
  </div> -->
</template>

<script>
  export default {
    props:['parentData','styleData'],
    data(){
      return{item:{},lazyPic:require('../../../assets/img/publicImg/loading_default.png') }
    },
    created(){
      this.item=this.parentData;
    },
    methods:{
      goodsDetail(){
        this.$emit('childEvent',this.item.id);
      }
    }
  }
</script>

<style lang="less" scoped>
.goods{
  width: 3.42rem;
  padding: 0.1rem 0.15rem;
  font-family: '微软雅黑';
  background: #fff;
  font-size: 0.3rem;
  box-sizing: border-box;
  position: relative;
  .picture{
    width: 100%;
    padding-top: 100%;
    position: relative;
    img{
      width: 100%;height: 100%;
      position: absolute;
      top: 0;left: 0;
    }
  }
  .title{
    height: 0.4rem;
    line-height: 0.4rem;
    font-size: 0.24rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .price{
    line-height: 0.36rem;
    padding-top: 0.04rem;
    font-size: 0.2rem;
    color: #D21D3D;
    i,em,del{font-style: normal;}
    .curr{font-weight: 600;i{font-size: 0.18rem;}}
  }
  .btn{
    width: 0.8rem;height: 0.3rem;
    color: #fff;
    border-radius: 0.06rem;
    line-height: 0.3rem;
    font-size: 0.16rem;
    text-align: center;
    position: absolute;
    bottom: 0.08rem;right: 0.06rem;
    background: #D21D3D;
  }
}
</style>